import { shallow as vueShallow, mount as vueMount, createLocalVue } from 'vue-test-utils';
import Vuex from 'vuex';

const localVue = createLocalVue();
localVue.use(Vuex);

const shallow = (Component, { propsData = {}, store = {}, stubs = [] } = {}) => {
  const wrapper = vueShallow(Component, {
    propsData,
    store: new Vuex.Store(store),
    localVue,
  });

  return wrapper;
};

const mount = (Component, { propsData = {}, store = {}, stubs = [] } = {}) => {
  const wrapper = vueMount(Component, {
    propsData,
    store: new Vuex.Store(store),
    localVue,
  });

  return wrapper;
};

export { mount, shallow };
